package com.yulongtian.offers.day202209.day20220905;

/**
 * https://leetcode.cn/problems/fei-bo-na-qi-shu-lie-lcof/?plan=lcof&plan_progress=g8d07hi
 * @author YulongTian
 * @date 2022/9/5 - 16:56
 */
public class Test08 {
    public static void main(String[] args) {

    }

    public int fib(int n) {
        if(n<=1){
            return n;
        }
        long a=0l;
        long b=1l;
        long c=a+b;

        for(int i=2;i<=n;i++){
            c=(a+b)%1000000007;
            a=b;
            b=c;
        }
        return (int)(c%1000000007);

    }

}
